home *** CD-ROM | disk | FTP | other *** search
Wrap
ccccppppuuuusssseeeettttGGGGeeeettttNNNNaaaammmmeeeeLLLLiiiisssstttt((((3333xxxx)))) ccccppppuuuusssseeeettttGGGGeeeettttNNNNaaaammmmeeeeLLLLiiiisssstttt((((3333xxxx)))) NNNNAAAAMMMMEEEE cpusetGetNameList - get the list of names for all defined cpusets SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS ####iiiinnnncccclllluuuuddddeeee <<<<ccccppppuuuusssseeeetttt....hhhh>>>> ccccppppuuuusssseeeetttt____NNNNaaaammmmeeeeLLLLiiiisssstttt____tttt ****ccccppppuuuusssseeeettttGGGGeeeettttNNNNaaaammmmeeeeLLLLiiiisssstttt((((vvvvooooiiiidddd))));;;; DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN The _c_p_u_s_e_t_G_e_t_N_a_m_e_L_i_s_t function is used to obtain a list of the names for all the cpusets on the system. The function returns a pointer to a structure of type ccccppppuuuusssseeeetttt____NNNNaaaammmmeeeeLLLLiiiisssstttt____tttt (defined in <cpuset.h>). The function _c_p_u_s_e_t_G_e_t_N_a_m_e_L_i_s_t allocates the memory for the structure and all of its associated data. The user is responsible for freeing the memory using the function _c_p_u_s_e_t_F_r_e_e_N_a_m_e_L_i_s_t(3x). The ccccppppuuuusssseeeetttt____NNNNaaaammmmeeeeLLLLiiiisssstttt____tttt structure is defined as follows: typedef struct { int count; char **list; int *status; } cpuset_NameList_t; ccccoooouuuunnnntttt is the number of cpuset names in the list. lllliiiisssstttt references the list of names. ssssttttaaaattttuuuussss is a list of status flags that indicate the status of the corresponding cpuset name in lllliiiisssstttt. The following flag values may be used: _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______QQQQ_UUUU_EEEE_UUUU_EEEE______NNNN_AAAA_MMMM_EEEE Indicates that the corresponding name in lllliiiisssstttt is the name of a cpuset queue. _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______CCCC_PPPP_UUUU______NNNN_AAAA_MMMM_EEEE Indicates that the corresponding name in lllliiiisssstttt is the CPU ID for a restricted CPU. The memory for lllliiiisssstttt and ssssttttaaaattttuuuussss is allocated when the ccccppppuuuusssseeeetttt____NNNNaaaammmmeeeeLLLLiiiisssstttt____tttt is allocated and it is released when the ccccppppuuuusssseeeetttt____NNNNaaaammmmeeeeLLLLiiiisssstttt____tttt structure is released. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS This example obtains the list of names for all cpuset queues configured on the system. The list of cpusets or restricted CPU IDs is then printed. PPPPaaaaggggeeee 1111 ccccppppuuuusssseeeettttGGGGeeeettttNNNNaaaammmmeeeeLLLLiiiisssstttt((((3333xxxx)))) ccccppppuuuusssseeeettttGGGGeeeettttNNNNaaaammmmeeeeLLLLiiiisssstttt((((3333xxxx)))) cpuset_NameList_t *names; /* Get the list of names else print error & exit */ if ( !(names = cpusetGetNameList()) ) { perror("cpusetGetNameList"); exit(1); } if (names->count == 0) { printf("No defined CPUSETs or restricted CPUs\n"); } else { int i; printf("CPUSET and restricted CPU names:\n"); for (i = 0; i < names->count; i++) { if (names->status[i] == CPUSET_CPU_NAME) { printf("CPU_ID[%s]\n", names->list[i]); } else { printf("CPUSET[%s]\n", names->list[i]); } } } cpusetFreeNameList(names); NNNNOOOOTTTTEEEESSSS _c_p_u_s_e_t_G_e_t_N_a_m_e_L_i_s_t is found in the library "libcpuset.so", and will be loaded if the option _----_llll_cccc_pppp_uuuu_ssss_eeee_tttt is used with _cccc_cccc(1) or _llll_dddd(1). SSSSEEEEEEEE AAAALLLLSSSSOOOO cpuset(1), cpusetFreeNameList(3x), cpuset(5). DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS If successful, _c_p_u_s_e_t_G_e_t_N_a_m_e_L_i_s_t returns a pointer to a ccccppppuuuusssseeeetttt____NNNNaaaammmmeeeeLLLLiiiisssstttt____tttt structure. If _c_p_u_s_e_t_G_e_t_N_a_m_e_L_i_s_t fails, it returns NULL and eeeerrrrrrrrnnnnoooo is set to indicate the error. The possible values for eeeerrrrrrrrnnnnoooo include those values set by _s_y_s_m_p(2) and _s_b_r_k(2). PPPPaaaaggggeeee 2222